
package clases;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.DefaultTableModel;

public class PanelPagosExtraEmpleados extends javax.swing.JPanel {

    Statement ST;
    
    public PanelPagosExtraEmpleados() {
        initComponents();
        this.setBounds(400, 25,1000, 200);
    }

    public void setST(Statement stmt){
        ST = stmt;
        
          ResultSet pendientes = null;
        DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();
        
        try {
            pendientes = ST.executeQuery("select * from pago_extra");
            while (pendientes.next()) {
                String[] datos = {pendientes.getString("ID_Empleado"),pendientes.getString("Total_Vendido"),pendientes.getString("Venta")};
                modelo.addRow(datos);   
            }
            pendientes = ST.executeQuery("select * from pago_extra");
            while (pendientes.next()) {
                String[] datos = {pendientes.getString("ID_Empleado"),pendientes.getString("Total_Vendido"),pendientes.getString("Venta")};
                modelo.addRow(datos);
            
            
            }
        } catch (SQLException ex) {
            Logger.getLogger(PanelPedidosPendientes.class.getName()).log(Level.SEVERE, null, ex);
        }

        jTable1.setModel(modelo);
        
        
    }
   
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel10 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();

        jLabel10.setFont(new java.awt.Font("Lucida Bright", 1, 14)); // NOI18N
        jLabel10.setText("Pago_Extra");

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID Empleados", "ID Ventas", "TotalVenta"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 413, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel10;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    // End of variables declaration//GEN-END:variables
}
